import { _get, _post, _upload } from "./config";

export const userLogin = pms => _post('adminlogin/login.json', pms)
export const userLogout = () => _post('adminlogin/logout.json')
export const getAllAdmin = pms => _get('admin/getAllAdmin.json', pms)
export const addAdmin = pms => _post('admin/addAdmin.json', pms)
export const deleteAdmin = pms => _post('admin/deleteAdmin.json', pms)

/* poster */
export const addPost = pms => _post('admin/addPost.json', pms)
export const deletePost = pms => _post('admin/deletePost.json', pms)
export const selectAllPost = () => _get('coursemanager/selectAllPost.json')
export const updatePostName = pms => _post('admin/updatePostName.json', pms)
// export const insertPicture = pms => _get('groupholder/insertPicture.json', pms)
export const uploadToServer = (pms) => _upload('admin/insertPicture.json', pms)

/* holders */
export const passHolders = pms => _post('admin/passHolders.json', pms)
export const rejectHolders = pms => _post('admin/rejectHolders.json', pms)
export const selectNotPassHolders = pms => _post('admin/selectNotPassHolders.json', pms)
export const selectPassHolders = pms => _post('admin/selectPassHolders.json', pms)
export const deleteHolders = pms => _post('admin/deleteHolders.json', pms)
export const getCustomers = pms => _get('admin/getCustomersByHolderId.json', pms)

/* course */
// export const getAllLesson = pms => _get('admin/getAllLesson.json', pms)
export const getLesson = pms => _get('admin/getLessonByPrimaryKey.json', pms)
export const selectLesson = pms => _post('admin/selectLessonExt.json', pms)
export const insertLesson = pms => _post('admin/insertLessonBasicInfo.json', pms)
export const deleteLesson = pms => _post('admin/deleteLessonByPrimaryKey.json', pms)
export const updateIntro = pms => _post('admin/updateGroupContent.json', pms)
export const updateLesson = pms => _post('admin/updateLessonBasicInfo.json', pms)
export const updateOnline = pms => _post('admin/updateOnline.json', pms)

